
import dao.AlunoDao;
import dao.CursoDao;
import dao.PessoaDao;
import entidades.Aluno;
import entidades.Curso;
import entidades.Pessoa;
import infra.CriadorDeSession;
import infra.CriadorDeSessionFactory;

/*
 *  Copyright (C) void Team 2010 Pedro Batista
 * 
 *  http://code.google.com/p/capacitec
 * 
 *  This file is part of capacitec.
 * 
 *  capacitec is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  capacitec is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with capacitec.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 *
 * @author pedro
 */
public class NewClass {

	public static void main(String[] args) {
		Aluno a = new Aluno();
		a.setPessoa(new Pessoa());
		a.getPessoa().setCep("oe");
		a.setPessoaId(5);

		CriadorDeSessionFactory factory = new CriadorDeSessionFactory();
		factory.abre();
		CriadorDeSession session = new CriadorDeSession(factory.getInstance());
		session.abre();

		AlunoDao dao = new AlunoDao(session.getInstance(),
			new PessoaDao(session.getInstance()));
		PessoaDao pDao = new PessoaDao(session.getInstance());

		CursoDao cDao = new CursoDao(session.getInstance());
		Curso c = new Curso();
		c.setId(1);
		cDao.recarrega(c);

		Pessoa p = new Pessoa();
		p.setCpf("134.512.309-87");
		//p.setId(5);
		pDao.recarrega(p);

		dao.recarrega(a);

		session.fecha();
		factory.fecha();
	}

}
